package com.zmc.lostfound.auth.vo;

import com.zmc.lostfound.common.valid.ValueIntList;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.URL;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * @author zmc
 * @description 用户修改基本信息请求体
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("用户修改基本信息请求体")
public class UserUpdateVO implements Serializable {

    private static final long serialVersionUID = 1507044780470429091L;

    /**
     * 用户id
     */
    @ApiModelProperty("用户id")
    @NotNull(message = "用户id不能为空")
    @Min(value = 1, message = "用户id必须大于等于1")
    private Long id;

    /**
     * 昵称
     */
    @ApiModelProperty("昵称")
    @Length(min = 1, max = 15, message = "昵称长度限制为1~15个字符")
    private String nickname;

    /**
     * 头像访问链接
     */
    @ApiModelProperty("头像访问链接")
    @URL(message = "头像访问链接不合法")
    private String imgUrl;

    /**
     * 性别(0：女；1：男)
     */
    @ApiModelProperty("性别(0：女；1：男)")
    @ValueIntList(values = {0, 1}, message = "性别只能为0或1[0:女，1:男]")
    private Integer sex;

}
